package com.xuecheng.apollo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *     测试 Apollo 读取配置项测试
 * </p>
 */
@RestController
@RequestMapping("hello")
public class ApolloController {

    /**
     * 从 Apollo 中获得配置信息
     */
    @Value("${sms.name}")
    private String name;


    @GetMapping("name")
    public String getName() {
        return name;
    }

}